home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / wnos5src.zip / INTERNET.H < prev    next >
Text File  |  1993-08-09  |  2KB  |  66 lines

  1. #ifndef    _INTERNET_H
  2. #define _INTERNET_H
  3.  
  4. #ifndef _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. /* Global structures and constants pertaining to the interface between IP and
  9.  *     higher level protocols
  10.  */
  11.  
  12. /* IP protocol field values */
  13. #define    ICMP_PTCL        1    /* Internet Control Message Protocol */
  14. #define    TCP_PTCL        6    /* Transmission Control Protocol */
  15. #define    UDP_PTCL        17    /* User Datagram Protocol */
  16. #define AX25_PTCL        93    /* AX.25 inside IP according to RFC-1226 */
  17. #define IP_PTCL            94    /* IP inside IP */
  18.  
  19. #define    MAXTTL            255    /* Maximum possible IP time-to-live value */
  20.  
  21. /* DoD-style precedences */
  22. #define    ROUTINE            0x00
  23. #define    PRIORITY        0x20
  24. #define    IMMEDIATE        0x40
  25. #define    FLASH            0x60
  26. #define    FLASH_OVER        0x80
  27. #define    CRITIC            0xa0
  28. #define    INET_CTL        0xc0
  29. #define    NET_CTL            0xe0
  30.  
  31. /* Amateur-style precedences */
  32. #define    AM_ROUTINE        0x00
  33. #define    AM_WELFARE        0x20
  34. #define    AM_PRIORITY        0x40
  35. #define    AM_EMERGENCY    0x60
  36.  
  37. /* Class-of-service bits */
  38. #define    LOW_DELAY        0x10
  39. #define    THROUGHPUT        0x08
  40. #define    RELIABILITY        0x04
  41.  
  42. /* IP TOS fields */
  43. #define    PREC(x)            (((x)>>5) & 7)
  44. #define    DELAY            0x10
  45. #define    THRUPUT            0x8
  46. #define    RELIABLITY        0x4
  47.  
  48. /* Pseudo-header for TCP and UDP checksumming */
  49. struct pseudo_header {
  50.     int32 source;        /* IP source */
  51.     int32 dest;            /* IP destination */
  52.     char protocol;        /* Protocol */
  53.     int16 length;        /* Data field length */
  54. };
  55. #define    NULLHEADER    (struct pseudo_header *)0
  56.  
  57. /* Format of a MIB entry for statistics gathering */
  58. struct mib_entry {
  59.     char *name;
  60.     union {
  61.         int32 integer;
  62.     } value;
  63. };
  64.  
  65. #endif    /* _INTERNET_H */
  66.